<?php
/**
 * Created by PhpStorm.
 * User: xushuhui
 * Date: 2017/12/12
 * Time: 17:04
 */

namespace app\admin\model;


class Activity extends BaseModel
{
    public function getStatusNameAttr($value,$data)
    {
        $status = [0=>'未审核',1=>'已通过',-1=>'未通过'];
        return $status[$data['status']];
    }
    public function order()
    {
        return $this->hasOne('Order','activity_id','id');
    }
    public function user()
    {
        return $this->belongsTo('User','uid');
    }
}